import React from 'react'
import PureRenderMixin from 'react-addons-pure-render-mixin'

import SearchHeader from '../../components/SearchHeader/index.jsx';
import SearchList from './subpage/List.jsx';
class Search extends React.Component {
    constructor(props, context) {
        super(props, context);
        this.shouldComponentUpdate = PureRenderMixin.shouldComponentUpdate.bind(this);
    }
    render() {
        //获取参数
        const params = this.props.params;
        //console.log('category param: ' + params.category) :分类
        //console.log('key param:' + params.keyword)：搜索框中的值
        return (
            <div>
                <SearchHeader
                    {...{
                       keyword:params.keyword
                    }}
                /> 
                <SearchList keyword={params.keyword} category={params.category}/>   
            </div>
        )
    }
 
}

// 使用 require.ensure 异步加载，还不支持 ES6 的 export 
// export default Search
module.exports = Search